﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microhard.Permission.Models;
using FluentValidation;

namespace Microhard.Permission.Validator
{
    public class FileAttachmentValidator : AbstractValidator<AttachmentFile>
    {
        public FileAttachmentValidator()
        {
            RuleSet("Insert", () => {
                RuleFor(u => u.DataID).NotEmpty().WithMessage("附件相关的业务ID丢失");
                RuleFor(u => u.File).NotEmpty ().WithMessage("附件丢失");
                RuleFor(u => u.FileName).NotEmpty().WithMessage("附件文件名丢失");
            });
        }
    }
}
